

global.RequestMapping = options => {

	options.method = options.method || 'all';
	options.method = options.method.toLowerCase();

	return (target, property, descriptor) => {

		var _constructor = target.constructor;

    //	console.log('RequestMapping', descriptor, property,  target[property]);

   		if(!_constructor) return;
   		// Class
   		if(!property && !descriptor) {
   			target._Server_ = options;
   		}else{
   			_constructor._server_ = _constructor._server_ || [];
   			_constructor._server_.push({method: property, config: options})
   		}

    }
}

global.Controller = (target, property, descriptor) => {

	//	console.log('Controller', target, descriptor, property);
		target._isController_ = true;
		target._Server_ = target._Server_ || {};
}

export default {};